/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package model;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;

/**
 *
 * @author rosi
 */
public class SettingConnection {

    public String bacaUser() throws FileNotFoundException, IOException {
        String userStr;
        FileReader userInStream = null;
        
        File userFile = new File("file/user.txt");
        userInStream = new FileReader(userFile);
        BufferedReader readUser = new BufferedReader(userInStream);
        
        userStr = readUser.readLine();
        readUser.close();
        return userStr;
    }

    public String bacaPass() throws FileNotFoundException, IOException {
        String userStr;
        FileReader userInStream = null;
        
        File userFile = new File("file/pass.txt");
        userInStream = new FileReader(userFile);
        BufferedReader readUser = new BufferedReader(userInStream);
        
        userStr = readUser.readLine();
        readUser.close();
        return userStr;
    }

    public String bacaUrl() throws FileNotFoundException, IOException {
        String userStr;
        FileReader userInStream = null;
        
        File userFile = new File("file/url.txt");
        userInStream = new FileReader(userFile);
        BufferedReader readUser = new BufferedReader(userInStream);
        
        userStr = readUser.readLine();
        readUser.close();
        return userStr;
    }

    public String bacaDBName() throws FileNotFoundException, IOException {
        String userStr;
        FileReader userInStream = null;
        
        File userFile = new File("file/DBName.txt");
        userInStream = new FileReader(userFile);
        BufferedReader readUser = new BufferedReader(userInStream);
        
        userStr = readUser.readLine();
        readUser.close();
        return userStr;
    }
    
    public String bacaClassName() throws FileNotFoundException, IOException {
        String userStr;
        FileReader userInStream = null;
        
        File userFile = new File("file/ClassName.txt");
        userInStream = new FileReader(userFile);
        BufferedReader readUser = new BufferedReader(userInStream);
        
        userStr = readUser.readLine();
        readUser.close();
        return userStr;
    }

}
